//
//  DetailHeaderView.m
//  FairyDream
//
//  Created by dllo on 15/8/21.
//  Copyright (c) 2015年 dreams. All rights reserved.
//

#import "DetailHeaderView.h"
#define Width 375
#define Height 450
@interface DetailHeaderView ()
@property (nonatomic, retain) UIView *bigView;
@property (nonatomic, retain) UIImageView *topImageView;
@property (nonatomic, retain) UIImageView *headerImage;
@property (nonatomic, retain) UILabel *nameLable;
@property (nonatomic, retain) UILabel *titleLable;
@property (nonatomic, retain) UILabel *timeLable;
@property (nonatomic, retain) UILabel *dateLable;
@property (nonatomic, retain) UILabel *mileageLable;
@property (nonatomic, retain) UILabel *kilometreLable;
@property (nonatomic, retain) UILabel *likeLable;
@property (nonatomic, retain) UILabel *likeNumLable;
@property (nonatomic, retain) UIImageView *routeImageView;
@property (nonatomic, retain) UIImageView *flightImageView;
@property (nonatomic, retain) UILabel *flightLable;
@property (nonatomic, retain) UIImageView *hotelImageView;
@property (nonatomic, retain) UILabel *hotelLable;
@property (nonatomic, retain) UIImageView *scenicSpotImageView;
@property (nonatomic, retain) UILabel *scenicSpotLable;
@property (nonatomic, retain) UIImageView *restaurantImageView;
@property (nonatomic, retain) UILabel *restaurantLable;
@property (nonatomic, retain) UIImageView *addressImageView;
@property (nonatomic, retain) UILabel *addressLable;
@property (nonatomic, retain) UILabel *noteLable;
@end

@implementation DetailHeaderView

- (void)dealloc
{
    [_bigView release];
    [_topImageView release];
    [_headerImage release];
    [_nameLable release];
    [_titleLable release];
    [_timeLable release];
    [_dateLable release];
    [_mileageLable release];
    [_kilometreLable release];
    [_likeLable release];
    [_likeNumLable release];
    [_routeImageView release];
    [_flightImageView release];
    [_flightLable release];
    [_hotelImageView release];
    [_scenicSpotImageView release];
    [_scenicSpotLable release];
    [_restaurantImageView release];
    [_restaurantLable release];
    [_addressImageView release];
    [_addressLable release];
    [_noteLable release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createImageViews];
    }
    return self;
}

- (void)createImageViews
{
    // 大View
    self.bigView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, Width, Height)];
    
    self.bigView.backgroundColor = [UIColor blueColor];
    [self addSubview:_bigView];
    [_bigView release];
    
    
    // 最上边的图片
    self.topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, Width, 160)];
    self.topImageView.backgroundColor = [UIColor yellowColor];
    [self addSubview:_topImageView];
    [_topImageView release];
    
    // 头像的ImageView
    self.headerImage = [[UIImageView alloc] initWithFrame:CGRectMake(162.5, 135, 50, 50)];
    self.headerImage.backgroundColor = [UIColor blackColor];
    [self addSubview:_headerImage];
    [_headerImage release];
    
    // 名字的Lable
    self.nameLable = [[UILabel alloc] initWithFrame:CGRectMake(87.5, 190, 200, 20)];
    self.nameLable.backgroundColor = [UIColor whiteColor];
    [self addSubview:_nameLable];
    [_nameLable release];
    
    // 标题的Lable
    self.titleLable = [[UILabel alloc] initWithFrame:CGRectMake(0, 215, Width, 30)];
    self.titleLable.backgroundColor = [UIColor purpleColor];
    [self addSubview:_titleLable];
    [_titleLable release];
    
    // 时间Lable
    self.timeLable = [[UILabel alloc] initWithFrame:CGRectMake(                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              50, 250, 100, 15)];
    self.timeLable.backgroundColor = [UIColor yellowColor];
    [self addSubview:_timeLable];
    [_timeLable release];
    
    // 天数lable
    self.dateLable = [[UILabel alloc] initWithFrame:CGRectMake(50, 270, 100, 15)];
    self.dateLable.backgroundColor = [UIColor redColor];
    [self addSubview:_dateLable];
    [_dateLable release];
    
    // 里程Lable
    self.mileageLable = [[UILabel alloc] initWithFrame:CGRectMake(150, 250, 75, 15)];
    self.mileageLable.backgroundColor = [UIColor greenColor];
    [self addSubview:_mileageLable];
    [_mileageLable release];
    
    // 千米Lable
    self.kilometreLable = [[UILabel alloc] initWithFrame:CGRectMake(150, 270, 75, 15)];
    self.kilometreLable.backgroundColor = [UIColor blackColor];
    [self addSubview:_kilometreLable];
    [_kilometreLable release];
    
    // 喜欢Lable
    self.likeLable = [[UILabel alloc] initWithFrame:CGRectMake(225, 250, 100, 15)];
    self.likeLable.backgroundColor = [UIColor redColor];
    [self addSubview:_likeLable];
    [_likeLable release];
    
    // 喜欢数量Lable
    self.likeNumLable = [[UILabel alloc] initWithFrame:CGRectMake(225, 270, 100, 15)];
    self.likeNumLable.backgroundColor = [UIColor greenColor];
    [self addSubview:_likeNumLable];
    [_likeNumLable release];
    
    // 线路图片
    self.routeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 310, Width, Height - 310)];
    self.routeImageView.backgroundColor = [UIColor purpleColor];
    [self addSubview:_routeImageView];
    [_routeImageView release];
    
    // 航班图片
    self.flightImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 320, 20, 20)];
    self.flightImageView.backgroundColor = [UIColor brownColor];
    [self addSubview:_flightImageView];
    [_flightImageView release];
    
    // 航班lable
    self.flightLable = [[UILabel alloc] initWithFrame:CGRectMake(37.5, 322.5, 80, 15)];
    self.flightLable.backgroundColor = [UIColor blueColor];
    [self addSubview:_flightLable];
    [_flightImageView release];
    
    // 住宿图片
    self.hotelImageView = [[UIImageView alloc] initWithFrame:CGRectMake(187.5, 320, 20, 20)];
    self.hotelImageView.backgroundColor = [UIColor redColor];
    [self addSubview:_hotelImageView];
    [_hotelImageView release];
    
    // 住宿lable
    self.hotelLable = [[UILabel alloc] initWithFrame:CGRectMake(210, 322.5, 80, 15)];
    self.hotelLable.backgroundColor = [UIColor greenColor];
    [self addSubview:_hotelLable];
    [_hotelImageView release];
    
    // 景点图片
    self.scenicSpotImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 360, 20, 20)];
    self.scenicSpotImageView.backgroundColor = [UIColor orangeColor];
    [self addSubview:_scenicSpotImageView];
    [_scenicSpotImageView release];
    
    // 景点lable
    self.scenicSpotLable = [[UILabel alloc] initWithFrame:CGRectMake(37.5, 362.5, 80, 15)];
    self.scenicSpotLable.backgroundColor = [UIColor magentaColor];
    [self addSubview:_scenicSpotLable];
    [_scenicSpotLable release];
    
    // 餐饮图片
    self.restaurantImageView = [[UIImageView alloc] initWithFrame:CGRectMake(187.5, 360, 20, 20)];
    self.restaurantImageView.backgroundColor = [UIColor darkGrayColor];
    [self addSubview:_restaurantImageView];
    [_restaurantImageView release];
    
    // 餐饮Lable
    self.restaurantLable = [[UILabel alloc] initWithFrame:CGRectMake(210, 362.5, 80, 15)];
    self.restaurantLable.backgroundColor = [UIColor orangeColor];
    [self addSubview:_restaurantLable];
    [_restaurantLable release];
    
    // 地址图片
    self.addressImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 400, 20, 20)];
    self.addressImageView.backgroundColor = [UIColor cyanColor];
    [self addSubview:_addressImageView];
    [_addressImageView release];
    
    // 地址Lable
    self.addressLable = [[UILabel alloc] initWithFrame:CGRectMake(37.5, 402.5, 150, 15)];
    self.addressLable.backgroundColor = [UIColor redColor];
    [self addSubview:_addressLable];
    [_addressLable release];
    
    // 查看日记
    self.noteLable = [[UILabel alloc] initWithFrame:CGRectMake(140, 425, 95, 15)];
    self.noteLable.backgroundColor = [UIColor yellowColor];
    [self addSubview:_noteLable];
    [_noteLable release];
}




@end
